home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_inf_flyingrobot.cog < prev    next >
Text File  |  1999-11-15  |  12KB  |  409 lines

  1. # Jones 3D Cog Script
  2. #
  3. # INF_FlyingRobot.cog
  4. # Controls the robot sector thing
  5. #
  6. # [SXC]
  7. #
  8. # (C) 1998 LucasArts Entertainment Co. All Rights Reserved
  9. # ========================================================================================
  10.  
  11. symbols
  12.  
  13.     message     activate
  14.     message     startup
  15.     message     pulse
  16.     message     arrived
  17.     message     timer
  18.     
  19.     message     user0       # right imp part inserted
  20.     message     user1       # wrong part inserted
  21.     message     user2       # no part inserted
  22.     
  23.     cog         exitcog
  24.     cog         hintcog
  25.     
  26.     sector      aethsector
  27.     
  28.     surface     safeface0
  29.     surface     safeface1
  30.     surface     safeface2
  31.     
  32.     surface     aethadjoin0
  33.     surface     aethadjoin1
  34.     surface     aethadjoin2
  35.     surface     aethadjoin3
  36.     surface     aethadjoin4
  37.     surface     aethadjoin5
  38.     surface     aethadjoin6
  39.     surface     aethadjoin7
  40.     surface     aethadjoin8
  41.     surface     aethadjoin9
  42.     surface     aethadjoin10
  43.     surface     aethadjoin11
  44.     surface     aethadjoin12
  45.     surface     aethadjoin13
  46.     surface     aethadjoin14
  47.     surface     aethadjoin15
  48.     
  49.     thing       player                                      local
  50.     thing       actorindy
  51.     thing       horseman                                    
  52.     
  53.     thing       robo_tgt0
  54.     thing       robo_tgt1
  55.     thing       robo_cam0
  56.     thing       robo_cam1
  57.     thing       robo_cam2
  58.     
  59.     thing       cam_pos0
  60.     thing       cam_tgt0
  61.     
  62.     keyframe    head_on_anim=0mr_headon.key                 local
  63.     
  64.     thing       whipstrut
  65.     thing       whipstrut1 
  66.     
  67.     thing       impstand                                        
  68.     thing       marduk_leggs
  69.  
  70.     thing       bigdoor0                                    linkid=4
  71.     thing       bigdoor1                                    linkid=4
  72.     sector      doorsector
  73.     
  74.     thing       generator_pos
  75.     
  76.     sound       horsemanline=im11i02.wav                    local
  77.     sound       doorslide=olv_quetzdoor_move_c.wav          local
  78.     sound       doorstop=olv_quetzdoor_stop_c.wav           local
  79.     sound       horsemusic=mus_inf_horseride.wav            local
  80.     sound       strutrotate=shs_clock_gears.wav             local
  81.     sound       strutstop=nub_elev_stop_c.wav               local
  82.     
  83.     #horseman sounds
  84.     sound       horsewalk=mus_inf_chapel.wav                local
  85.     sound       horse_headopen=inf_mr_headopen.wav          local
  86.     sound       mardukline=im11i02.wav                      local
  87.     
  88.     # just won't open lines...
  89.     sound        in_line0=Inxj096.wav                        local # I can't open it-->insayline[25]
  90.     sound        in_line1=Inxj097.wav                        local # For some reason...won't open.
  91.     sound        in_line2=Inxj098.wav                        local # It won't budge.
  92.     sound        in_line3=Inxj099.wav                        local # Something is holding this door closed.
  93.     sound        in_line4=Inxj102.wav                        local # must be way...don't know how.
  94.     
  95.     int         x                                           local
  96.     int         y                                           local
  97.     int         doorchan                                    local
  98.     int         headchannel                                 local
  99.     int         headkey                                     local
  100.     int         strutchan                                   local
  101.     int         doneonce=0                                  local
  102.     int         levitatorin=1                               local
  103.     int         toggleint=0                                 local
  104.     int         headchannel                                 local
  105.     int         blocker=0                                   local
  106.     int         voiceflag=0                                 local
  107.     template    e_pool=EnergyWhirlpool                      local
  108.     
  109.     material    botmat=mrhdfr.mat                           local
  110.     thing       m_voiceactor
  111.       
  112. end
  113.  
  114.  
  115. code
  116. #........................................................................................
  117. startup:
  118.  
  119.     //inital conditions
  120.     SectorAdjoins(doorsector, 0);
  121.     
  122.     //AISetCutsceneMode(horseman);
  123.     SetThingFlags(horseman, 0x80000);
  124.     ClearThingFlags(whipstrut, 0x80000000);     //non whip
  125.     ClearThingFlags(whipstrut1, 0x80000000);     //non whip
  126.     ClearAdjoinFlags(safeface0, 0x2);
  127.     ClearAdjoinFlags(safeface1, 0x2);
  128.     ClearAdjoinFlags(safeface2, 0x2);
  129.     player = GetLocalPlayerThing();
  130.     Sleep(1);
  131.     
  132.     //setting adjoins to 80 opacity
  133.     for(y=0; y<=15; y=y+1)
  134.     {
  135.         SetAdjoinAlpha(aethadjoin0[y], 80);
  136.         Sleep(0.01);
  137.     }
  138.     
  139.     //Rotate Spars downward
  140.     Rotate(whipstrut, -90, 2, 3);
  141.     Rotate(whipstrut1, -90, 2, 3);
  142.     SetPulse(2);
  143.     
  144. return;
  145.  
  146. #........................................................................................
  147. activate:
  148.  
  149.     If ((GetSenderID() == 4) && (GetCurFrame(bigdoor0) == 0) && (blocker == 0))
  150.     {
  151.         blocker = 1;
  152.         StartCutscene(1);
  153.         StopThing(player);
  154.         SetActorFlags(player, 0x200000);
  155.         DeselectWeaponWait(player);
  156.         PlayVoice(player, in_line0[(RandBetween(0,4))], 1, 1);
  157.         ClearActorFlags(player, 0x200000);
  158.         EndCutscene();
  159.         blocker = 0;
  160.     }
  161.     
  162. return;
  163.  
  164. #........................................................................................
  165.     
  166. //right part
  167. user0:
  168.  
  169.     SendMessage(hintcog, user0);
  170.     SetPulse(0);
  171.     //prep cameras
  172.     SetCameraLookInterp(2, 0);
  173.     SetCameraPosInterp(2, 0);
  174.     SetCameraInterpSpeed(2, 0);
  175.     Sleep(0.001);
  176.     
  177.     //cut around to front pointing at head slightly below bot
  178.     SetCameraSecondaryFocus(2, robo_tgt0);
  179.     SetCameraFocus(2, robo_cam0);
  180.     SetCurrentCamera(2);
  181.     SetCameraFOV(40, 0, 0);
  182.     sleep(0.01);
  183.     SetCameraFOV(30, 1, 8);
  184.     PlaySoundLocal(horsemusic, 0.65, 0, 0x0, 0);
  185.     
  186.     //destroy the old static marduk
  187.     DestroyThing(marduk_leggs);
  188.     DestroyThing(impstand);
  189.     
  190.     //reveal the actor marduk
  191.     SetThingLight(horseman, '1 1 1', 0.02, 0);
  192.     ClearThingFlags(horseman, 0x80000);
  193.     AISetCutsceneMode(horseman);
  194.     AttachThingtoThing(robo_tgt0, horseman);
  195.     PlaySoundThing(horse_headopen, horseman, 1, 10, 20, 0x0080);
  196.     headkey = PlayKey(horseman, head_on_anim, 2, 0x14, 0);
  197.     SetTimer(0.1);
  198.     voiceflag=0;
  199.     //PlayVoice(player, mardukline, 1, 1);
  200.     PlayVoice(m_voiceactor, mardukline, 1, 1);
  201.     voiceflag=1;
  202.     SetMaterialCel(botmat, 1);
  203.     Sleep(1);
  204.     
  205.     //start the horseman walking
  206.     AISetMoveSpeed(horseman, 1);
  207.     AISetMoveFrame(horseman, 1);
  208.     SetCollideType(horseman, 0);
  209.     Sleep(3.5);
  210.     
  211.     //cut around to front of door
  212.     SetCameraFocus(2, robo_cam1);
  213.     SetCurrentCamera(2);
  214.     SetCameraFOV(70, 0, 0);
  215.     AttachThingtoThing(robo_cam1, horseman);
  216.     
  217.     //doors opening
  218.     SectorAdjoins(doorsector, 1);
  219.     doorchan=PlaySoundThing(doorslide, bigdoor0, 0.75, 30, 50, 0x0081);
  220.     MoveToFrame(bigdoor0, 1, 1);
  221.     MoveToFrame(bigdoor1, 1, 1);
  222.     Sleep(1);
  223.     AIWaitForStop(horseman);
  224.     Sleep(1);
  225.     SetCameraFocus(2, robo_cam2);
  226.     SetCurrentCamera(2);
  227.     SetCameraFOV(40, 0, 0);
  228.     Sleep(1);
  229.     //StopKey(horseman, headkey, 1);
  230.     headchannel = PlaySoundThing(horse_headopen, horseman, 1, 10, 20, 0x0080);
  231.     WaitForSound(headchannel);
  232.     SetMaterialCel(botmat, 0);
  233.     Sleep(0.5);
  234.                                         
  235.     //return control to player
  236.     CopyOrientAndPos(actorindy, player);
  237.     SetThingFlags(actorindy, 0x80000);
  238.     ClearActorFlags(player, 0x200000);
  239.     ClearThingFlags(player, 0x10);
  240.     ClearThingFlags(player, 0x80000);
  241.     SetCurrentCamera(1);
  242.     SetCameraFOV(90, 0, 0);
  243.     EndCutscene();
  244.     SetCollideType(horseman, 3);    
  245.  
  246.     //sets okaytofinish to 1 in INF_Cinematic_Exit
  247.     SendMessage(exitcog, user7);
  248.     
  249. return;
  250.  
  251. #........................................................................................
  252. // the levitator part
  253. user1:
  254.  
  255.     levitatorin=1;
  256.     StartCutscene(1);
  257.     SetActorFlags(player, 0x200000);
  258.     StopThing(player);
  259.     SetCameraFocus(2, cam_pos0);
  260.     SetCameraSecondaryFocus(2, cam_tgt0);
  261.     SetCurrentCamera(2);
  262.     SetCameraFOV(100, 0, 0);
  263.     
  264.     //fade the aeth sector in
  265.     for(x=0; x<=80; x=x+20)
  266.     {
  267.         for(y=0; y<=15; y=y+1)
  268.         {
  269.             SetAdjoinAlpha(aethadjoin0[y], x);
  270.             Sleep(0.001);
  271.         }
  272.         
  273.     }
  274.     SetSectorFlags(aethsector, 0x0100);
  275.     ClearThingFlags(whipstrut, 0x80000000);     //non whip
  276.     ClearThingFlags(whipstrut1, 0x80000000);     //non whip
  277.     
  278.     strutchan=PlaySoundThing(strutrotate, whipstrut, 1, 30, 50, 0x0081);
  279.     Rotate(whipstrut, -90, 2, 3);
  280.     Rotate(whipstrut1, -90, 2, 3);
  281.     Sleep(3.5);
  282.     StopSound(strutchan, 0);
  283.     PlaySoundThing(strutstop, whipstrut, 1, 30, 50, 0x0080);
  284.     
  285.     //no move
  286.     ClearAdjoinFlags(safeface0, 0x2);
  287.     ClearAdjoinFlags(safeface1, 0x2);
  288.     ClearAdjoinFlags(safeface2, 0x2);
  289.     SetPulse(2);
  290.     Sleep(5);
  291.     
  292.     CopyOrientAndPos(actorindy, player);
  293.     SetThingFlags(actorindy, 0x80000);
  294.     ClearActorFlags(player, 0x200000);
  295.     ClearThingFlags(player, 0x10);
  296.     ClearThingFlags(player, 0x80000);
  297.     SetCurrentCamera(1);
  298.     SetCameraFOV(90, 0, 0);
  299.     EndCutscene();
  300.     
  301. return;
  302.  
  303. #........................................................................................
  304. //no part
  305. user2:
  306.  
  307.     if (levitatorin != 1) return;
  308.     Sleep(1);
  309.     levitatorin = 0;
  310.     StartCutscene(1);
  311.     //print("hit startcutscene");
  312.     SetActorFlags(player, 0x200000);
  313.     
  314.     StopThing(player);
  315.     SetCameraFocus(2, cam_pos0);
  316.     SetCameraSecondaryFocus(2, cam_tgt0);
  317.     SetCurrentCamera(2);
  318.     SetCameraFOV(110, 0, 0);
  319.     
  320.     //make moveable
  321.     SetAdjoinFlags(safeface0, 0x2);
  322.     SetAdjoinFlags(safeface1, 0x2);
  323.     SetAdjoinFlags(safeface2, 0x2);
  324.     
  325.     //fade the aeth sector out
  326.     for(x=80; x>=0; x=x-20)
  327.     {
  328.         for(y=0; y<=15; y=y+1)
  329.         {
  330.             SetAdjoinAlpha(aethadjoin0[y], x);
  331.             Sleep(0.001);
  332.         }
  333.         
  334.     }
  335.     ClearSectorFlags(aethsector, 0x0100);
  336.     SetThingFlags(whipstrut, 0x80000000);       //make strut whippable
  337.     SetThingFlags(whipstrut1, 0x80000000);     //non whip
  338.     
  339.     strutchan=PlaySoundThing(strutrotate, whipstrut, 1, 30, 50, 0x0081);
  340.     Rotate(whipstrut, 90, 2, 3);
  341.     Rotate(whipstrut1, 90, 2, 3);
  342.     Sleep(3.5);
  343.     StopSound(strutchan, 0);
  344.     PlaySoundThing(strutstop, whipstrut, 1, 30, 50, 0x0080);
  345.     
  346.     SetPulse(0);
  347.     Sleep(4);
  348.     
  349.     CopyOrientAndPos(actorindy, player);
  350.     SetThingFlags(actorindy, 0x80000);
  351.     ClearActorFlags(player, 0x200000);
  352.     ClearThingFlags(player, 0x10);
  353.     ClearThingFlags(player, 0x80000);
  354.     SetCurrentCamera(1);
  355.     SetCameraFOV(90, 0, 0);
  356.     EndCutscene();
  357.         
  358. return;
  359.  
  360. #........................................................................................
  361. //particle generation
  362. pulse:
  363.         
  364.     CreateThing(e_pool, generator_pos);
  365.     
  366. return;
  367.     
  368. #........................................................................................
  369. timer:
  370.     toggleint=1-toggleint;
  371.     if (voiceflag == 1)
  372.     {
  373.         return;
  374.     }
  375.     
  376.     if(toggleint == 0)
  377.     {
  378.         SetMaterialCel(botmat, 1);
  379.         SetTimer(RandBetween(1, 2)*0.05);
  380.         return;
  381.     }
  382.     
  383.     if(toggleint == 1)
  384.     {
  385.         SetMaterialCel(botmat, 0);
  386.         SetTimer(RandBetween(1, 2)*0.05);
  387.         return;
  388.     }
  389.     
  390. return;
  391.  
  392. #........................................................................................
  393.  
  394. arrived:
  395.     
  396.     If (GetSenderRef() == bigdoor0)
  397.     {
  398.         StopSound(doorchan, 0);
  399.         PlaySoundThing(doorstop, bigdoor0, 1, 30, 50, 0x0080);
  400.     }
  401.     
  402. return;
  403.     
  404. #........................................................................................
  405.  
  406. end
  407.  
  408.  
  409.